<?
    if (isset($_POST['username']))
    {
        $r = $user->addUser($_POST);
        if ($r !== true)
        {
            $error[] = $r;
        }
        else
        {
            refreshPage('config', array('add'=>1));
        }
    }
    
    if (isset($_GET['add']) && $_GET['add'] == 1)
    {
        $note[] = 'User added successfully!';
    }

    $users = $user->getAllUsers($inactive=0);
    $smarty->assign('users', $users);
    $inactive_users = $user->getAllUsers($inactive=1);
    $smarty->assign('inactive_users', $inactive_users);
?>